#ifndef _NODE_H_
#define _NODE_H_

#include <vector>
#include <map>
#include "AbstractEntity.h"

using namespace std;

#define SIZE_LEAF 800
#define NUM_NODE 4

class CNode
{
public:
	CNode(int id);
	CNode(int id, Rect* rect);
	~CNode();

	
	int id;
	Rect* _Bound;
	CNode* parent;
	map<int, CNode*>* childs;

	bool isLeaf();
	void addChild(CNode*);
	void addGameObjects(AbstractEntity* obj);
	void getObject(map<int, AbstractEntity*>* currentObject, Rect* view);

	void deleteNode();
	void deleteObjectsInNode();
	
	
private:
	map<int, AbstractEntity*>* _gameObjects;
	void _getObject(map<int, AbstractEntity*>* currentObject);
};

#endif
